
/* Generated by Interface Builder */

#import "DefaultMgr.h"
#import "strings.h"
#import <appkit/Form.h>

@implementation DefaultMgr

- setFloatForm:anObject
{
    floatForm = anObject;
    return self;
}

- setStringForm:anObject
{
    stringForm = anObject;
    return self;
}

- setIntegerForm:anObject
{
    integerForm = anObject;
    return self;
}

- writeDefaults:sender
{
NXStream *stream;
	myFloat = [floatForm floatValueAt:0];
	myInt = [integerForm intValueAt:0];
	printf("b %s\n", myString);
	strcpy(myString, [stringForm stringValueAt:0]);
	printf("a %s\n", myString);
	stream = NXMapFile("defaults", NX_WRITEONLY);
	NXPrintf(stream, "%i %5.2f %s\n", myInt, myFloat, myString);
	NXFlush(stream);
	NXSaveToFile(stream, "defaults");
	NXCloseMemory(stream, NX_FREEBUFFER);
    return self;
}

- readDefaults:sender
{
NXStream *stream;
	stream = NXMapFile("defaults", NX_READONLY);
	NXScanf(stream, "%i %f %s", &myInt, &myFloat, myString);
	[integerForm setIntValue:myInt];
	[floatForm setFloatValue:myFloat];
	[stringForm setStringValue:myString];
	NXCloseMemory(stream, NX_FREEBUFFER);
    return self;
}


@end
